<template>
  <div class="">
    <ul id="ul">
      <li v-for="(item, index) in list" :key="index">
        <van-image :src="item.product_picture">
          <template v-slot:loading>
            <van-loading type="spinner" size="20" />
          </template>
        </van-image>
        <p>{{ item.product_name }}</p>
        <p>￥{{ item.product_price }}</p>
        <p>{{ item.product_intro }}</p>
      </li>
    </ul>
  </div>
</template>

<script>
import { Lazyload } from "vant";
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    this.$axios
      .post("/product/getHotProduct", {
        categoryName: ["电视机", "空调", "洗衣机", "保护套"],
      })
      .then((res) => {
        // console.log(res);
        this.list = res.data.Product;
        // console.log(this.list);
      });
  },
  methods: {},
};
</script>

<style lang="scss">
#ul {
  width: 100%;
  background: aqua;
  li {
    width: 30%;
    height: 350px;
    // border: black 1px solid;
    float: left;
    margin: 15px;
    transition-duration: 0.3s;
    div {
      height: 65%;
      // background: blue;
    }
  }
  li:hover {
    -webkit-box-shadow: #ccc 0px 10px 10px;
    -moz-box-shadow: #ccc 0px 10px 10px;
    box-shadow: #ccc 0px 10px 10px;
  }
}
</style>
